<a href="https://github.com/socketstream/socketstream/edit/master/lib/client/bundler/default.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/default.js#L33" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">default</code>
<div><span class="hint">service in module <code ng:non-bindable="">bundler</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="bundler-default-page bundler-default-default-page"><p>The default bundler of HTML, CSS &amp; JS</p>
</div></div>
<div class="member method"><h2 id="methods">Methods</h2>
<ul class="methods"><li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/proto.js#L169" class="view-source icon-eye-open"> </a><h3 id="methods_entries">entries(assetType, systemAssets)</h3>
<div class="entries"><div class="bundler-default-page bundler-default-default-entries-page"><p>Provides the view and the pack functions with a
list of entries for an asset type relative to the client directory.
The default implementation is used.</p>
<p>An entry describes:</p>
<ul>
<li>file: source file name relative to client directory</li>
<li>importedFrom: Pulled in by require in other file</li>
<li>content: If pre-loaded</li>
<li>type: If system asset it will have type lib/mod</li>
<li>bundle: which production bundle (html, tmpl, css, js, worker)</li>
<li>assetType: css, js, html</li>
<li>extension: source file extension</li>
</ul>
</div><h5 id="methods_entries_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>assetType</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-default-page bundler-default-default-entries-page"><p>js/css/tmpl</p>
</div></td></tr><tr><td>systemAssets</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="bundler-default-page bundler-default-default-entries-page"><p>Collection of libs, modules, initCode</p>
</div></td></tr></tbody></table><h5 id="methods_entries_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">[AssetEntry]</a></td><td><div class="bundler-default-page bundler-default-default-entries-page"><p>List of output entries</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/proto.js#L274" class="view-source icon-eye-open"> </a><h3 id="methods_htmltags">htmlTags(type, pack)</h3>
<div class="htmltags"><div class="bundler-default-page bundler-default-default-htmltags-page"><p>Function called by view.js to build the view HTML</p>
</div><h5 id="methods_htmltags_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>type</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-default-page bundler-default-default-htmltags-page"><p>Either start/js/css</p>
</div></td></tr><tr><td>pack</td><td><a href="" class="label type-hint type-hint-boolean">Boolean</a></td><td><div class="bundler-default-page bundler-default-default-htmltags-page"><p>Pack with resolveAssetLink ?</p>
</div></td></tr></tbody></table><h5 id="methods_htmltags_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">[String]</a></td><td><div class="bundler-default-page bundler-default-default-htmltags-page"><p>List of script tag strings</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/proto.js#L51" class="view-source icon-eye-open"> </a><h3 id="methods_load">load()</h3>
<div class="load"><div class="bundler-default-page bundler-default-default-load-page"><p>Called when the server is started. Does nothing.</p>
</div></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/proto.js#L189" class="view-source icon-eye-open"> </a><h3 id="methods_system">system()</h3>
<div class="system"><div class="bundler-default-page bundler-default-default-system-page"><p>Return entries for the loader/start/module depending on includes.system client config and system assets.
Multiple arguments will attempt to add module for the name.
Special module names are &#39;loader&#39; and &#39;start&#39;.</p>
</div><h5 id="methods_system_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-assetentry">AssetEntry</a></td><td><div class="bundler-default-page bundler-default-default-system-page"><p>Resource entries array</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/proto.js#L374" class="view-source icon-eye-open"> </a><h3 id="methods_tominifiedcss">toMinifiedCSS(files)</h3>
<div class="tominifiedcss"><div class="bundler-default-page bundler-default-default-tominifiedcss-page"><p>Minify JavaScript using CleanCSS</p>
</div><h5 id="methods_tominifiedcss_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>files</td><td><a href="" class="label type-hint type-hint-array">Array</a></td><td><div class="bundler-default-page bundler-default-default-tominifiedcss-page"><p>Entries with file path and content to be minified</p>
</div></td></tr></tbody></table><h5 id="methods_tominifiedcss_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-default-page bundler-default-default-tominifiedcss-page"><p>Minified content</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/proto.js#L389" class="view-source icon-eye-open"> </a><h3 id="methods_tominifiedjs">toMinifiedJS(files)</h3>
<div class="tominifiedjs"><div class="bundler-default-page bundler-default-default-tominifiedjs-page"><p>Minify JavaScript using Uglify</p>
</div><h5 id="methods_tominifiedjs_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>files</td><td><a href="" class="label type-hint type-hint-array">Array</a></td><td><div class="bundler-default-page bundler-default-default-tominifiedjs-page"><p>Entries with file path and content to be minified</p>
</div></td></tr></tbody></table><h5 id="methods_tominifiedjs_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-default-page bundler-default-default-tominifiedjs-page"><p>Minified content</p>
</div></td></tr></table></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/proto.js#L61" class="view-source icon-eye-open"> </a><h3 id="methods_unload">unload()</h3>
<div class="unload"><div class="bundler-default-page bundler-default-default-unload-page"><p>Called when the server is stopped. Does nothing.</p>
</div></div>
</li>
<li><a href="https://github.com/socketstream/socketstream/blob/3f3f67a/lib/client/bundler/proto.js#L312" class="view-source icon-eye-open"> </a><h3 id="methods_wrapcode">wrapCode(assetType, systemAssets)</h3>
<div class="wrapcode"><div class="bundler-default-page bundler-default-default-wrapcode-page"><p>Before client-side code is sent to the browser any file which is NOT a library (e.g. /client/code/libs)
is wrapped in a module wrapper (to keep vars local and allow you to require() one file in another).</p>
<p>The &#39;system&#39; directory is a special case - any module placed in this dir will not have a leading slash</p>
</div><h5 id="methods_wrapcode_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>assetType</td><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="bundler-default-page bundler-default-default-wrapcode-page"><p>js/css/tmpl</p>
</div></td></tr><tr><td>systemAssets</td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="bundler-default-page bundler-default-default-wrapcode-page"><p>Collection of libs, modules, initCode</p>
</div></td></tr></tbody></table><h5 id="methods_wrapcode_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">[AssetEntry]</a></td><td><div class="bundler-default-page bundler-default-default-wrapcode-page"><p>List of output entries</p>
</div></td></tr></table></div>
</li>
</ul>
</div>
</div>
